<!--
  Copyright 2018 The Outline Authors

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<link rel='import' href='../bower_components/polymer/polymer.html'>
<link rel='import' href='../bower_components/paper-button/paper-button.html'>
<link rel='import' href='../bower_components/paper-dialog/paper-dialog.html'>

<link rel='import' href='./cloud-install-styles.html'>

<dom-module id='outline-metrics-option-dialog'>
  <template>
    <style include='cloud-install-styles'></style>
    <paper-dialog id='metricsEnabledDialog' modal>
      <div class='dialogBanner'><img src='images/metrics.png'></div>
      <h3>Metrics sharing</h3>
      <p>Share anonymized metrics to help improve the reliability and performance of Outline, for you and for those you share your server with. <a class="learnMoreLink" href="https://s3.amazonaws.com/outline-vpn/index.html#/en/support/dataCollection">Learn more</a>.</p>
      <div class='buttons'>
        <paper-button dialog-dismiss on-tap='disableMetricsRequested'>Skip</paper-button>
        <paper-button autofocus dialog-dismiss on-tap='enableMetricsRequested'>Share metrics</paper-button>
      </div>
    </paper-dialog>
  </template>
  <script>
    Polymer({
      is: 'outline-metrics-option-dialog',
      showMetricsOptInDialog: function() {
        this.$.metricsEnabledDialog.open();
      },
      enableMetricsRequested: function() {
        this.fire('EnableMetricsRequested');
      },
      disableMetricsRequested: function() {
        this.fire('DisableMetricsRequested');
      }
    });
  </script>
</dom-module>
